package com.zyh.inner;

public class InnerClassDemo2 {
    public static void main(String[] args) {

        Outer.Inner inner = new Outer.Inner();
        System.out.println(inner.num);
        System.out.println(inner.innerNum);
        inner.method();
        inner.innerNum();
        Outer.Inner.staticInnerNum();
    }
}

class Outer {
    public int num = 10;
    public int outerNum = 100;

    public void method() {
        System.out.println("我是外部类method方法");
    }

    public void outerMethod() {
        System.out.println("我是外部类outerMethod方法");
    }

    static class Inner {
        public int num = 20;
        public int innerNum = 200;

        public void method() {
            System.out.println("这是内部类的method方法");
        }

        public void innerNum() {
            System.out.println("这是内部类的innerNum方法");
        }

        public static void staticInnerNum() {
            System.out.println("这是内部类的静态方法");
        }
    }

}


